var data=[
  {
    name:"获取百度智能token",
    content:`
      <p>function platetoken() {</p>
        <p style="text-indent:40px">var grant_type = "client_credentials"</p>
        <p style="text-indent:40px">var client_id = "gvtvAWjh7N8dzp5ks775tU8l"; //apiKey</p>
        <p style="text-indent:40px">var client_secret = "fBvnEtwYHxC4O55iy4plaMDrCzVsIbqU "; //secretkey</p>
        <p style="text-indent:40px">var url = "http://aip.baidubce.com/oauth/2.0/token?grant_type=" + grant_type + "&client_id=" + client_id + "&client_secret=" + client_secret</p>
        <p style="text-indent:40px">$axios.post(url).then(res => {</p>
          <p style="text-indent:60px">var token = res.data.access_token + "time=" + new Date().getTime()</p>
          <p style="text-indent:60px">localStorage.setItem("plateToken", token)</p>
        <p style="text-indent:40px">})</p>
      <p>}</p>
    `
  },{
    name:"文字识别请求数据",
    content:`
    <p>function plate(img,result) {</p>
      <p style="text-indent:40px">var params = {</p>
        <p style="text-indent:60px">image:<span style="color:red" title="base64去掉头部">UrlEncode(img)</span>,</p>
        <p style="text-indent:60px">accuracy:"",//是否使用高精度</p>
      <p style="text-indent:40px">}</p>
      <p style="text-indent:40px">var token = localStorage.getItem("plateToken").split("time=")[0]</p>
      <p style="text-indent:40px">var url="/baiduapi"+(result.general?"vehicle_license":"license_plate")+"?access_token=" + token //本地调试</p>
      <p style="text-indent:40px">// var url=+result.general?"https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_license?access_token=":"https://aip.baidubce.com/rest/2.0/ocr/v1/license_plate?access_token="// 上线</p>
      <p style="text-indent:40px">$.ajax({</p>
        <p style="text-indent:60px">type: "post",</p>
        <p style="text-indent:60px">url:url,</p>
        <p style="text-indent:60px">dataType: "json",</p>
        <p style="text-indent:60px">data: params,</p>
        <p style="text-indent:60px">headers: { 'contentType': 'application/x-www-form-urlencoded' },</p>
        <p style="text-indent:60px">success: function (data) {</p>
          <p style="text-indent:80px">console.log(data)</p>
        <p style="text-indent:60px">},</p>
        <p style="text-indent:60px">error: function (data) { </p>
          <p style="text-indent:80px">console.log(data)</p>
        <p style="text-indent:60px">},</p>
      <p style="text-indent:40px">});</p>
    <p>}</p>


    `
  }
]

export default data